/*
 * FunctionBoundaryCondistionforThermalResponse.h
 *Function boudary condition data to compute ablation
 *  Created on: Jan 17, 2022
 *      Author: liuxiao
 */


#pragma once

#include "Material.h"
#include "libmesh/meshfree_interpolation.h"
using std::string;
using std::vector;

class Function;

class FunctionBoundaryCondistionforThermalResponse : public Material
{
public:
	FunctionBoundaryCondistionforThermalResponse(const InputParameters& parameters);

protected:
	virtual void computeProperties();

private:
	//  cold wall heat flux at given wall temperature
	MaterialProperty<Real>& _qc;
	//  cold wall heat flux at 0K
	MaterialProperty<Real>& _qc_0K;
	//  recovery enthalpy
	MaterialProperty<Real>& _hr;
	//  pressure at boundary edge,Pa;
	MaterialProperty<Real>& _Pe;
	//  pressure at boundary edge,atm;
	MaterialProperty<Real>& _Pe_atm;
	//  pressure of O2 at boundary edge,atm;
	MaterialProperty<Real>& _Pe_O2;
	//  pressure of N2 at boundary edge,atm;
	MaterialProperty<Real>& _Pe_N2;
	//  average molar mass of gas out of boundary layer,kg/mol
	MaterialProperty<Real>& _M_e;
	//wall temperature at which heat flux computed
	MaterialProperty<Real>& _Tw_qc;
	//wall temperature
	const VariableValue& _Tw;
	//partial pressure of O2 at boundary edge,1
	Real _Pe_O2_p;
	//partial pressure of N2 at boundary edge,1
	Real _Pe_N2_p;
	//  get average molar mass of gas out of boundary layer,kg/mol
	Real _M_e_p;
	//  get function of cold wall heat flux
	const Function& _qc_func;
	// get function of pressure at boundary edge,Pa
	const Function& _Pe_func;
	// get function of recovery enthalpy
	const Function& _hr_func;
	// get function of wall temperature
	const Function& _tw_func;

};

template<>
InputParameters validParams<FunctionBoundaryCondistionforThermalResponse>();

